#include <cstdio>
#include <string>
#include <iostream>
#include <map>
#include <iterator>
using namespace std;

map <string, int> dict;
map <string, int>::iterator pos;
int n;
int nemail;

void init()
{
    cin >> n;
    string tmp;
    string out="-1";
    for (int i=0; i<n; ++i)
    {
        cin >> tmp;
        dict[tmp] = 1;
    }   
    cin >> nemail;
    int ncase;
    for (ncase = 1; ncase<=nemail; ++ncase)
    {
        bool firstfind = true;
        while (1)
        {
            cin >> tmp;
            if (tmp == out) break;
            pos = dict.find(tmp);
            if (pos == dict.end()) 
            {
                if (firstfind)
                {
                    firstfind = false;
                    cout << "Email "<<ncase << " is not spelled correctly." << endl;
                }    
                cout << tmp << endl;
            }    
        } // end of whlie
        if (firstfind)
          cout <<   "Email "<<ncase <<" is spelled correctly." << endl;

    }    // end of case
    cout <<"End of Output"<<endl;
}    

int main()  
{
    init();  
        
                
    return 0;    
}         